package team.hyznrj.studentsys.entity;

import java.text.DecimalFormat;
import java.util.Map;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
 * 
 * @author 郑泽锋
 * @date 2018年5月20日
 */
@ToString
public class SimpleCourseResult extends StudentBasicMessage{
	/** 学号 */
//	private transient String sno;
	/** 总学科绩点*/
	private transient double first_item_mainPoint=0;
	/** 总成绩绩点*/
	private transient double first_item_gradePoint=0;
	/** 总学科绩点*/
	private transient double second_item_mainPoint=0;
	/** 总成绩绩点*/
	private transient double second_item_gradePoint=0;
	
	private transient double peCount=0;
	private transient double peGrade=0;
	/**平均绩点 */
	private transient double first_item_avgPoint=0;
	private transient double second_item_avgPoint=0;
	private transient double avgPoint=0;
	/**第一学期绩点*/
	private String finalFirstPoint;
	/**第二学期绩点*/
	private String finalSecondPoint;
	/**平均绩点*/
	private String finalAvgPoint;
	/**身体素质分*/
	private transient double pePoint=0;
	/**身体素质分*/
	private String finalPePoint;
	/**挂科数*/
	private int ggNum=0;
	private boolean g=false;
	/**排名*/
	private int order;
	/**查询年份*/
	private String year;
	public void count(){
		int count=0;
		DecimalFormat format=new DecimalFormat("0.00");
		if(first_item_gradePoint!=0&&first_item_mainPoint!=0){
			this.first_item_avgPoint=first_item_gradePoint/first_item_mainPoint;
			count++;
			finalFirstPoint=format.format(first_item_avgPoint);
		}else{
			finalFirstPoint=format.format(first_item_avgPoint);
		}
		if(second_item_gradePoint!=0&&second_item_mainPoint!=0){
			this.second_item_avgPoint=second_item_gradePoint/second_item_mainPoint;
			count++;
			finalSecondPoint=format.format(second_item_avgPoint);
		}else{
			finalSecondPoint=format.format(second_item_avgPoint);
		}
		if(count>0){
			avgPoint=(first_item_avgPoint+second_item_gradePoint)/count;
			finalAvgPoint=format.format(avgPoint);
		}else{
			finalAvgPoint="-";	
		}
		if(peCount!=0){
			pePoint=peGrade/peCount;
			finalPePoint=format.format(pePoint);
		}else{
			finalPePoint="-";
		}
	}
	
	
	public String getSno() {
		return sno;
	}
	public void setSno(String sno) {
		this.sno = sno;
	}
	public double getFirst_item_mainPoint() {
		return first_item_mainPoint;
	}
	public void setFirst_item_mainPoint(double first_item_mainPoint) {
		this.first_item_mainPoint = first_item_mainPoint;
	}
	public double getFirst_item_gradePoint() {
		return first_item_gradePoint;
	}
	public void setFirst_item_gradePoint(double first_item_gradePoint) {
		this.first_item_gradePoint = first_item_gradePoint;
	}
	public double getSecond_item_mainPoint() {
		return second_item_mainPoint;
	}
	public void setSecond_item_mainPoint(double second_item_mainPoint) {
		this.second_item_mainPoint = second_item_mainPoint;
	}
	public double getSecond_item_gradePoint() {
		return second_item_gradePoint;
	}
	public void setSecond_item_gradePoint(double second_item_gradePoint) {
		this.second_item_gradePoint = second_item_gradePoint;
	}
	public double getPeCount() {
		return peCount;
	}
	public void setPeCount(double peCount) {
		this.peCount = peCount;
	}
	public double getPeGrade() {
		return peGrade;
	}
	public void setPeGrade(double peGrade) {
		this.peGrade = peGrade;
	}
	public double getFirst_item_avgPoint() {
		return first_item_avgPoint;
	}
	public void setFirst_item_avgPoint(double first_item_avgPoint) {
		this.first_item_avgPoint = first_item_avgPoint;
	}
	public double getSecond_item_avgPoint() {
		return second_item_avgPoint;
	}
	public void setSecond_item_avgPoint(double second_item_avgPoint) {
		this.second_item_avgPoint = second_item_avgPoint;
	}
	public double getAvgPoint() {
		return avgPoint;
	}
	public void setAvgPoint(double avgPoint) {
		this.avgPoint = avgPoint;
	}
	public double getPePoint() {
		return pePoint;
	}
	public void setPePoint(double pePoint) {
		this.pePoint = pePoint;
	}
	public int getGgNum() {
		return ggNum;
	}
	public void setGgNum(int ggNum) {
		this.ggNum = ggNum;
	}
	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}
	public String getYear() {
		return year;
	}
	public void setYear(String year) {
		this.year = year;
	}


	public String getFinalFirstPoint() {
		return finalFirstPoint;
	}


	public void setFinalFirstPoint(String finalFirstPoint) {
		this.finalFirstPoint = finalFirstPoint;
	}


	public String getFinalSecondPoint() {
		return finalSecondPoint;
	}


	public void setFinalSecondPoint(String finalSecondPoint) {
		this.finalSecondPoint = finalSecondPoint;
	}


	public String getFinalAvgPoint() {
		return finalAvgPoint;
	}


	public void setFinalAvgPoint(String finalAvgPoint) {
		this.finalAvgPoint = finalAvgPoint;
	}


	public String getFinalPePoint() {
		return finalPePoint;
	}


	public void setFinalPePoint(String finalPePoint) {
		this.finalPePoint = finalPePoint;
	}


	public boolean isG() {
		return g;
	}


	public void setG(boolean g) {
		this.g = g;
	}
}
